// 用户编写的头文件
#include "G4BasicActionInitialization.hh"
#include "G4BasicPrimaryGeneratorAction.hh"
#include "G4BasicSteppingAction.hh"
#include "G4BasicEventAction.hh"
#include "G4BasicRunAction.hh"

void G4BasicActionInitialization::BuildForMaster() const{

    G4BasicRunAction* runAction = new G4BasicRunAction;
    SetUserAction(runAction);
}

void G4BasicActionInitialization::Build() const{

    // 将粒子发射的行为配置到runmanager中
    SetUserAction(new G4BasicPrimaryGeneratorAction);

    // 将run行为配置到runmanager中
    G4BasicRunAction* runAction = new G4BasicRunAction;
    SetUserAction(runAction);

    // 将event行为配置到runmanager中
    G4BasicEventAction* eventAction = new G4BasicEventAction(runAction);  
    SetUserAction(eventAction);

    // 将step行为配置到runmanager中
    G4BasicSteppingAction* steppingAction = new G4BasicSteppingAction(eventAction);
    SetUserAction(steppingAction);
    
}